package com.movie2.controller;

import com.movie2.model.entity.Activity;
import com.movie2.service.ActivityService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/activity")
@CrossOrigin
@Slf4j
public class ActivityController {
    @Autowired
    ActivityService activityService;

    @GetMapping("")
    public List<Activity> selectAllActivitys(){
        log.info("ActivityController -> selectAllActivitys()");
        return activityService.selectAllActivitys();
    }
}
